package com.code.hfd.command;

public class RemoteControl {
    Commmand[] onCommands;
    Commmand[] offCommands;
    // TODO: 2020/7/7 补全命令模式
    public RemoteControl() {
        this.onCommands = new Commmand[7];
        this.offCommands = new Commmand[7];
        Commmand noCommand = new NoCommand();
        for (int i = 0; i < 7; i++) {
//            onCommands[i] = noCommand;
//            offCommands[i] = noCommand;
            // 这里优化一点点
            setCommand(i,noCommand,noCommand);
        }
    }

    public void setCommand(int slot, Commmand onCommand, Commmand offCommand) {
        onCommands[slot] = onCommand;
        offCommands[slot] = offCommand;
    }



}
